﻿using System;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Volo.Abp;
using Volo.Abp.Application.Dtos;

namespace Acme.BookStore2.Controllers
{
    [RemoteService(Name = "Default")]
    [Area("bookstore2")]
    [ControllerName("VehicleInspectionRecord")]
    [Route("api/bookstore2/vehicleInspectionRecords")]
    public class VehicleInspectionRecordController : BookStore2Controller, IVehicleInspectionRecordAppService
    {
        private readonly IVehicleInspectionRecordAppService _vehicleInspectionRecordAppService;

        public VehicleInspectionRecordController(IVehicleInspectionRecordAppService vehicleInspectionRecordAppService)
        {
            this._vehicleInspectionRecordAppService = vehicleInspectionRecordAppService;
        }
        
        [HttpGet]
        [Route("{id}")]
        public Task<VehicleInspectionRecordDto> GetAsync(Guid id)
        {
            return _vehicleInspectionRecordAppService.GetAsync(id);
        }
        
        [HttpGet]
        public Task<PagedResultDto<VehicleInspectionRecordDto>> GetPagedListAsync(GetVehicleInspectionRecordsInput input)
        {
            return _vehicleInspectionRecordAppService.GetPagedListAsync(input);
        }
        
        [HttpPost]
        public Task<VehicleInspectionRecordDto> CreateAsync(VehicleInspectionRecordCreateDto input)
        {
            return _vehicleInspectionRecordAppService.CreateAsync(input);
        }

        [HttpPut]
        [Route("{id}")]
        public Task<VehicleInspectionRecordDto> UpdateAsync(Guid id, VehicleInspectionRecordUpdateDto input)
        {
            return _vehicleInspectionRecordAppService.UpdateAsync(id, input);
        }

        [HttpDelete]
        [Route("{id}")]
        public Task DeleteAsync(Guid id)
        {
            return _vehicleInspectionRecordAppService.DeleteAsync(id);
        }

        [HttpGet] 
        [Route("export")]
        public Task ExportAsync(GetVehicleInspectionRecordsInput input)
        {
            return _vehicleInspectionRecordAppService.ExportAsync(input);
        }
    }
}